package com.arellomobile.android.push.utils;

import org.json.JSONObject;

public class NetworkUtils
{
  private static final String BASE_URL = "http://cp.pushwoosh.com/json/1.3/";
  private static final String BASE_URL_SECURE = "https://cp.pushwoosh.com/json/1.3/";
  public static final int MAX_TRIES = 5;
  public static final String PUSH_VERSION = "1.3";
  private static final String TAG = "PushWoosh: NetworkUtils";
  public static boolean useSSL = false;

  // ERROR //
  public static NetworkResult makeRequest(java.util.Map<String, Object> paramMap, String paramString)
    throws java.lang.Exception
  {
    // Byte code:
    //   0: new 35	com/arellomobile/android/push/utils/NetworkUtils$NetworkResult
    //   3: dup
    //   4: sipush 500
    //   7: iconst_0
    //   8: aconst_null
    //   9: invokespecial 38	com/arellomobile/android/push/utils/NetworkUtils$NetworkResult:<init>	(IILorg/json/JSONObject;)V
    //   12: astore_2
    //   13: aconst_null
    //   14: astore_3
    //   15: aconst_null
    //   16: astore 4
    //   18: new 40	java/lang/StringBuilder
    //   21: dup
    //   22: ldc 8
    //   24: invokespecial 43	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   27: aload_1
    //   28: invokevirtual 47	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   31: invokevirtual 51	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   34: astore 6
    //   36: getstatic 26	com/arellomobile/android/push/utils/NetworkUtils:useSSL	Z
    //   39: istore 7
    //   41: aconst_null
    //   42: astore_3
    //   43: iload 7
    //   45: ifeq +21 -> 66
    //   48: new 40	java/lang/StringBuilder
    //   51: dup
    //   52: ldc 11
    //   54: invokespecial 43	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   57: aload_1
    //   58: invokevirtual 47	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   61: invokevirtual 51	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   64: astore 6
    //   66: new 53	java/net/URL
    //   69: dup
    //   70: aload 6
    //   72: invokespecial 54	java/net/URL:<init>	(Ljava/lang/String;)V
    //   75: invokevirtual 58	java/net/URL:openConnection	()Ljava/net/URLConnection;
    //   78: checkcast 60	java/net/HttpURLConnection
    //   81: astore 8
    //   83: aload 8
    //   85: ldc 62
    //   87: invokevirtual 65	java/net/HttpURLConnection:setRequestMethod	(Ljava/lang/String;)V
    //   90: aload 8
    //   92: ldc 67
    //   94: ldc 69
    //   96: invokevirtual 73	java/net/HttpURLConnection:setRequestProperty	(Ljava/lang/String;Ljava/lang/String;)V
    //   99: aload 8
    //   101: iconst_1
    //   102: invokevirtual 77	java/net/HttpURLConnection:setDoOutput	(Z)V
    //   105: new 79	org/json/JSONObject
    //   108: dup
    //   109: invokespecial 80	org/json/JSONObject:<init>	()V
    //   112: astore 9
    //   114: aload_0
    //   115: invokeinterface 86 1 0
    //   120: invokeinterface 92 1 0
    //   125: astore 10
    //   127: aload 10
    //   129: invokeinterface 98 1 0
    //   134: istore 11
    //   136: aconst_null
    //   137: astore_3
    //   138: iload 11
    //   140: ifne +213 -> 353
    //   143: new 79	org/json/JSONObject
    //   146: dup
    //   147: invokespecial 80	org/json/JSONObject:<init>	()V
    //   150: astore 12
    //   152: aload 12
    //   154: ldc 100
    //   156: aload 9
    //   158: invokevirtual 104	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   161: pop
    //   162: aload 8
    //   164: ldc 106
    //   166: aload 12
    //   168: invokevirtual 107	org/json/JSONObject:toString	()Ljava/lang/String;
    //   171: invokevirtual 113	java/lang/String:getBytes	()[B
    //   174: arraylength
    //   175: invokestatic 117	java/lang/String:valueOf	(I)Ljava/lang/String;
    //   178: invokevirtual 73	java/net/HttpURLConnection:setRequestProperty	(Ljava/lang/String;Ljava/lang/String;)V
    //   181: aload 8
    //   183: invokevirtual 121	java/net/HttpURLConnection:getOutputStream	()Ljava/io/OutputStream;
    //   186: astore_3
    //   187: aload_3
    //   188: aload 12
    //   190: invokevirtual 107	org/json/JSONObject:toString	()Ljava/lang/String;
    //   193: invokevirtual 113	java/lang/String:getBytes	()[B
    //   196: invokevirtual 127	java/io/OutputStream:write	([B)V
    //   199: aload_3
    //   200: invokevirtual 130	java/io/OutputStream:flush	()V
    //   203: aload_3
    //   204: invokevirtual 133	java/io/OutputStream:close	()V
    //   207: new 135	java/io/BufferedInputStream
    //   210: dup
    //   211: aload 8
    //   213: invokevirtual 139	java/net/HttpURLConnection:getInputStream	()Ljava/io/InputStream;
    //   216: invokespecial 142	java/io/BufferedInputStream:<init>	(Ljava/io/InputStream;)V
    //   219: astore 14
    //   221: new 144	java/io/ByteArrayOutputStream
    //   224: dup
    //   225: invokespecial 145	java/io/ByteArrayOutputStream:<init>	()V
    //   228: astore 15
    //   230: sipush 1024
    //   233: newarray byte
    //   235: astore 16
    //   237: aload 14
    //   239: aload 16
    //   241: invokevirtual 151	java/io/InputStream:read	([B)I
    //   244: istore 17
    //   246: iload 17
    //   248: ifge +159 -> 407
    //   251: aload 15
    //   253: invokevirtual 152	java/io/ByteArrayOutputStream:close	()V
    //   256: new 109	java/lang/String
    //   259: dup
    //   260: aload 15
    //   262: invokevirtual 155	java/io/ByteArrayOutputStream:toByteArray	()[B
    //   265: invokespecial 157	java/lang/String:<init>	([B)V
    //   268: invokevirtual 160	java/lang/String:trim	()Ljava/lang/String;
    //   271: astore 18
    //   273: ldc 20
    //   275: new 40	java/lang/StringBuilder
    //   278: dup
    //   279: ldc 162
    //   281: invokespecial 43	java/lang/StringBuilder:<init>	(Ljava/lang/String;)V
    //   284: aload 18
    //   286: invokevirtual 47	java/lang/StringBuilder:append	(Ljava/lang/String;)Ljava/lang/StringBuilder;
    //   289: invokevirtual 51	java/lang/StringBuilder:toString	()Ljava/lang/String;
    //   292: invokestatic 168	android/util/Log:w	(Ljava/lang/String;Ljava/lang/String;)I
    //   295: pop
    //   296: new 79	org/json/JSONObject
    //   299: dup
    //   300: aload 18
    //   302: invokespecial 169	org/json/JSONObject:<init>	(Ljava/lang/String;)V
    //   305: astore 20
    //   307: aload_2
    //   308: aload 20
    //   310: invokevirtual 173	com/arellomobile/android/push/utils/NetworkUtils$NetworkResult:setData	(Lorg/json/JSONObject;)V
    //   313: aload_2
    //   314: aload 8
    //   316: invokevirtual 177	java/net/HttpURLConnection:getResponseCode	()I
    //   319: invokevirtual 181	com/arellomobile/android/push/utils/NetworkUtils$NetworkResult:setCode	(I)V
    //   322: aload_2
    //   323: aload 20
    //   325: ldc 183
    //   327: invokevirtual 187	org/json/JSONObject:getInt	(Ljava/lang/String;)I
    //   330: invokevirtual 190	com/arellomobile/android/push/utils/NetworkUtils$NetworkResult:setPushwooshCode	(I)V
    //   333: aload 14
    //   335: ifnull +8 -> 343
    //   338: aload 14
    //   340: invokevirtual 191	java/io/InputStream:close	()V
    //   343: aload_3
    //   344: ifnull +7 -> 351
    //   347: aload_3
    //   348: invokevirtual 133	java/io/OutputStream:close	()V
    //   351: aload_2
    //   352: areturn
    //   353: aload 10
    //   355: invokeinterface 195 1 0
    //   360: checkcast 109	java/lang/String
    //   363: astore 21
    //   365: aload 9
    //   367: aload 21
    //   369: aload_0
    //   370: aload 21
    //   372: invokeinterface 199 2 0
    //   377: invokevirtual 104	org/json/JSONObject:put	(Ljava/lang/String;Ljava/lang/Object;)Lorg/json/JSONObject;
    //   380: pop
    //   381: goto -254 -> 127
    //   384: astore 5
    //   386: aload 4
    //   388: ifnull +8 -> 396
    //   391: aload 4
    //   393: invokevirtual 191	java/io/InputStream:close	()V
    //   396: aload_3
    //   397: ifnull +7 -> 404
    //   400: aload_3
    //   401: invokevirtual 133	java/io/OutputStream:close	()V
    //   404: aload 5
    //   406: athrow
    //   407: aload 15
    //   409: aload 16
    //   411: iconst_0
    //   412: iload 17
    //   414: invokevirtual 202	java/io/ByteArrayOutputStream:write	([BII)V
    //   417: goto -180 -> 237
    //   420: astore 5
    //   422: aload 14
    //   424: astore 4
    //   426: goto -40 -> 386
    //
    // Exception table:
    //   from	to	target	type
    //   18	41	384	finally
    //   48	66	384	finally
    //   66	127	384	finally
    //   127	136	384	finally
    //   143	221	384	finally
    //   353	381	384	finally
    //   221	237	420	finally
    //   237	246	420	finally
    //   251	333	420	finally
    //   407	417	420	finally
  }

  public static class NetworkResult
  {
    private int mPushwooshCode;
    private int mResultCode;
    private JSONObject mResultData;

    public NetworkResult(int paramInt1, int paramInt2, JSONObject paramJSONObject)
    {
      this.mResultCode = paramInt1;
      this.mPushwooshCode = paramInt2;
      this.mResultData = paramJSONObject;
    }

    public int getPushwooshCode()
    {
      return this.mPushwooshCode;
    }

    public int getResultCode()
    {
      return this.mResultCode;
    }

    public JSONObject getResultData()
    {
      return this.mResultData;
    }

    public void setCode(int paramInt)
    {
      this.mResultCode = paramInt;
    }

    public void setData(JSONObject paramJSONObject)
    {
      this.mResultData = paramJSONObject;
    }

    public void setPushwooshCode(int paramInt)
    {
      this.mPushwooshCode = paramInt;
    }
  }
}

/* Location:           E:\android\Toy Defense 2_dex2jar.jar
 * Qualified Name:     com.arellomobile.android.push.utils.NetworkUtils
 * JD-Core Version:    0.6.2
 */